export default function (){
  return new Promise((res,rej) => {
    window.init=function(){
      // eslint-disable-next-line no-undef
      res(BMapGL);
    };
    const scriptDOM =document.createElement('script');
    scriptDOM.type='text/javascript';
    scriptDOM.src='http://api.map.baidu.com/getscript?v=3.0&ak=N2p6isvbMjUuqa2yS1ZqxzCTttlxkKll';
    scriptDOM.onerror=rej;
    document.head.appendChild(scriptDOM);
  });
}
